package cz.pproproj.aaservice.aasdbmodule.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * @author David
 * @since 20. 1. 2015
 */
@Entity(name = "AasDbUserRoleDAO")
@Table(name = "USER_ROLES")
public class AasDbUserRoleDAO {

    private String _name;

    public AasDbUserRoleDAO() {
    }

    public AasDbUserRoleDAO(String name) {
        _name = name;
    }

    @Id
    @Column(name = "USER_ROLE_NAME")
    public String getName() {
        return _name;
    }

    public void setName(String name) {
        _name = name;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        AasDbUserRoleDAO that = (AasDbUserRoleDAO) o;

        return !(_name != null ? !_name.equals(that._name) : that._name != null);

    }

    @Override
    public int hashCode() {
        return _name != null ? _name.hashCode() : 0;
    }
}
